﻿package mortal.game.view.autoArena.renderer
{
    import Message.Public.*;
    import com.gengine.utils.*;
    import com.mui.controls.*;
    import extend.language.*;
    import mortal.common.global.*;
    import mortal.game.cache.*;
    import mortal.game.resource.*;
    import mortal.game.scene3D.layer3D.utils.*;
    import mortal.game.utils.*;
    import mortal.game.view.common.*;

    public class AutoArenaRecordListRenderer extends GCellRenderer
    {
        private var _challengeInfo:GTextFiled;
        private var _info:SAutoArenaRecord;

        public function AutoArenaRecordListRenderer()
        {
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            this._challengeInfo = UIFactory.gTextField("", 10, 13 - 5, 550, 20, this);
            this.pushUIToDisposeVec(UIFactory.bg(0, 37, 668 - 20, 2, this, ImagesConst.SplitLine));
            return;
        }// end function

        override public function set data(param1:Object) : void
        {
            var _loc_2:SArenaBasePlayer = null;
            var _loc_3:String = null;
            var _loc_4:int = 0;
            var _loc_5:String = null;
            var _loc_6:String = null;
            var _loc_7:String = null;
            var _loc_8:String = null;
            super.data = param1;
            this._info = param1 as SAutoArenaRecord;
            if (this._info)
            {
                _loc_4 = Cache.instance.autoArena.sAutoArenaMyInfo.rank;
                _loc_5 = this._info.cDt.minutes + "";
                if (this._info.cDt.minutes < 10)
                {
                    _loc_5 = "0" + this._info.cDt.minutes;
                }
                _loc_6 = Language.getStringByParam(41494, (this._info.cDt.month + 1), this._info.cDt.date, this._info.cDt.hours, _loc_5);
                if (EntityUtil.isSelf(this._info.fromPlayer.entityId))
                {
                    _loc_2 = this._info.toPlayer;
                    _loc_7 = NameUtil.getProxyName(_loc_2.entityId) + HTMLUtil.addColor(_loc_2.name, GlobalStyle.colorLv);
                    _loc_8 = Language.getStringByParam(41653, _loc_2.combat);
                    _loc_3 = this._info.isFail ? (Language.getString(41654)) : (Language.getStringByParam(41655, this._info.rankChange));
                    this._challengeInfo.htmlText = _loc_6 + Language.getString(41656) + _loc_7 + _loc_8 + _loc_3;
                }
                else
                {
                    _loc_2 = this._info.fromPlayer;
                    _loc_7 = NameUtil.getProxyName(_loc_2.entityId) + HTMLUtil.addColor(_loc_2.name, GlobalStyle.colorLv);
                    _loc_8 = Language.getStringByParam(41653, _loc_2.combat);
                    _loc_3 = this._info.isFail ? (Language.getStringByParam(41657, this._info.rankChange)) : (Language.getString(41658));
                    this._challengeInfo.htmlText = Language.getStringByParam(41659, _loc_6, _loc_7 + _loc_8, _loc_3);
                }
            }
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            super.disposeImpl();
            this._challengeInfo.dispose();
            this._challengeInfo = null;
            this._info = null;
            return;
        }// end function

    }
}
